package org.cloud.server.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author LHB
 * @date 2019/10/17 14:25
 */
@RestController
public class ClientController {

    // git配置文件里的key
//    @Value("${bus}")
//    private String del;

    @RequestMapping("/get")
    public String get() {
        return "访问成功";
    }

    @RequestMapping("/getUser")
    public String get(@RequestParam(name = "name")String name) {

        return new User(name,"男").toString();
    }

    class  User{
        private String name;
        private String age;

        public User(String name, String age) {
            this.name = name;
            this.age = age;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getAge() {
            return age;
        }

        public void setAge(String age) {
            this.age = age;
        }
    }
}
